package com.htbb.common.base;

import org.springframework.util.StringUtils;

/**
 * @date 2016-12-27
 * @description 返回结果基本类
 * @author wangzhicheng
 *
 * @param <T>
 */
public class Result<T> {
	/**
	 * msgCode 返回状态码
	 */
	private String msgCode = SUCCESS;
	/**
	 * msg 返回信息
	 */
	private String msg = "";
	
	private T model;
	

	public static final String SUCCESS="success";
	public static final String FAILED="failed";
	
	public Result(){}
	
	public Result(String msgCode, String msg){
		if(StringUtils.isEmpty(msgCode)){
			this.msgCode = SUCCESS;
		}else{
			this.msgCode = msgCode;
		}
		this.msg = msg;
	}
	
	public Result(T model){
		this.model = model;
	}
	
	public String getMsgCode() {
		return msgCode;
	}

	public void setMsgCode(String msgCode) {
		this.msgCode = msgCode;
	}

	public String getMsg() {
		return msg;
	}

	public T getModel() {
		return model;
	}

	public void setModel(T model) {
		this.model = model;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
